package ui.panel.warriorLevelups
{

	import flash.display.Bitmap;
	import flash.display.Sprite;

	import globals.ButtonType;
	import globals.Global;

	import ui.component.Label;
	import ui.component.TextButton;

	import util.UIUtil;

	public class WarriorLevelUpNeed extends Sprite
	{
		private var icon:Bitmap;
		private var nameLabel:Label;
		private var jobLabel:Label;
		private var levelLabel:Label;
		private var costLabel:Label;
		private var levelupButton:TextButton;

		public function WarriorLevelUpNeed()
		{
			super();

			icon = new Bitmap();
			addChild(icon);
			icon.bitmapData = Global.assetsManager.getAssetsAsBitmapData("", "ui");

			var label:Label;
			label = new Label(12, 0xFFFFFF);
			label.x = 10;
			label.y = 100;
			label.text = "改造需求：";

			nameLabel = new Label(12, 0xFFFFFF);
			nameLabel.x = 20;
			nameLabel.y = 130;
			addChild(nameLabel);
			jobLabel = new Label(12, 0xFFFFFF);
			jobLabel.x = 20;
			jobLabel.y = 150;
			addChild(jobLabel);
			levelLabel = new Label(12, 0xFFFFFF);
			levelLabel.x = 20;
			levelLabel.y = 170;
			addChild(levelLabel);
			costLabel = new Label(12, 0xFFFFFF);
			costLabel.x = 20;
			costLabel.y = 200;
			addChild(costLabel);

			levelupButton = UIUtil.getTextButton(0, "晋级", ButtonType.BUTTON_BLUE, levelupHandler);
			levelupButton.x = 20;
			levelupButton.y = 200;
			addChild(levelupButton);
		}

		private function levelupHandler(button:TextButton):void
		{

		}

		public function update(name:String, job:String, level:uint, cost:uint):void
		{
			nameLabel.text = "英雄：" + name;
			jobLabel.text = "职业：" + job;
			levelLabel.text = "等级：" + level.toString();
			costLabel.text = "消耗：" + cost.toString();
		}

		public function clear():void
		{

		}
	}
}